#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 2e5 + 5;

int n, m, t;
int sx, sy, fx, fy;
int a[9][9], vis[9][9];
int ans;
int dx[] = {-1, 0, 1, 0}, dy[] = {0, 1, 0, -1};

void dfs(int x, int y) {
  if (x == fx && y == fy) {
    ans++;
    return;
  }
  if (x < 1 || x > n || y < 1 || y > n) return;
  if (vis[x][y] || a[x][y]) return;
  vis[x][y] = 1;
  rep(i, 0, 3) {
    int xx = x + dx[i], yy = y + dy[i];
    dfs(xx, yy);
  }
  vis[x][y] = 0;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> m >> t;
  cin >> sx >> sy >> fx >> fy;
  rep(i, 1, t) {
    int x, y;
    cin >> x >> y;
    a[x][y] = 1;
  }
  if (a[fx][fy] == 1) {
    cout << 0;
    return 0;
  }
  dfs(sx, sy);
  cout << ans;
  return 0;
}